<form id="pagerForm" method="post" action="<?php echo SITE_URL . 'index.php?a=new';?>">
    <input type="hidden" name="pageNum" value="1" />
    <input type="hidden" name="numPerPage" value="<?php echo $list['pager']->per_page;?>" />
    <input type="hidden" name="title" value="<?php echo $_input->post('title');?>" />
    <input type="hidden" name="status" value="<?php echo $_input->post('status');?>" />
</form>


<div class="pageHeader">
    <form onsubmit="return navTabSearch(this);" action="<?php echo SITE_URL . 'index.php?a=new';?>" method="post">
        <div class="searchBar">
            <table class="searchContent">
                <tr>
                    <td>
                        资讯名：<input type="text" name="title" value="<?php echo $_input->post('title');?>"/>
                    </td>
                    <td>
                        <select class="combox" name="source_id">
                            <option value="">请选择来源</option>
                            <?php
                                foreach($source_list as $k=>$v){
                            ?>
                            <option value="<?php echo $k; ?>"><?php echo $v; ?></option>
                            <?php
                                }
                            ?>
                        </select>
                    </td>
                    <td>
                    <select class="combox" name="category_id">
                        <option value="">请选择类别</option>
                        <?php
                            foreach($category_list as $k=>$v){
                        ?>
                        <option value="<?php echo $k; ?>"><?php echo $v; ?></option>
                        <?php
                            }
                        ?>
                    </select>
                    </td>
                    <td>
                        <select class="combox" name="status">
                            <option value="">请选择状态</option>
                            <option value="1">待审核</option>
                            <option value="2">审核通过</option>
                            <option value="3">审核未通过</option>
                        </select>
                    </td>
                    <td><div class="button"><div class="buttonContent"><button type="submit">搜索</button></div></div></td>
                </tr>
            </table>
        </div>
    </form>
</div>
<div class="pageContent">
    <div class="panelBar">
        <ul class="toolBar">
            <li><a class="add" href="<?php echo SITE_URL . 'index.php?a=new&m=add';?>" target="dialog" height="550" width="900" rel="add_cate"><span>添加</span></a></li>
            <li class="line">line</li>
            <li><a class="delete" href="<?php echo SITE_URL . 'index.php?a=new&m=del';?>&new_id={sid}" target="ajaxTodo" title="确定要删除吗?"><span>删除</span></a></li>
            <li class="line">line</li>
            <li><a class="edit" href="<?php SITE_URL . 'index.php?a=new&m=edit';?>&new_id={sid}" target="dialog" mask="true" height="550" width="900"><span>修改</span></a></li>
        </ul>
    </div>
    <table class="table treeTable" width="100%" layoutH="112">
        <thead>
        <tr>
            <th width="30" align="center">ID</th>
            <th width="160" align="center">资讯名称</th>
            <th width="80" align="center">来源</th>
            <th width="50" align="center">类别</th>
            <th width="50" align="center">状态</th>
            <th width="50" align="center">更新日期</th>
            <th width="50" align="center">发布日期</th>
            <th width="100" align="center">操作</th>
        </tr>
        </thead>
        <tbody>
        <?php foreach($list['rs'] as $v){?>
            <tr target="sid" rel="<?php echo $v['new_id'];?>" >
                <td><?php echo $v['new_id'];?></td>
                <td><?php echo $v['title'];?></td>
                <td><?php echo changeShow($v['source_id'],$source_list);?></td>
                <td><?php echo changeShow($v['category_id'],$category_list);?></td>
                <td style="color:<?php echo $v['status'] != 1 ? ( $v['status'] == 2 ? 'green':'red') : 'black';?>"><?php echo $v['status'] != 1 ? ( $v['status'] == 2 ? '审核通过':'审核未通过') : '待审核';?></td>
                <td><?php echo $v['update_time'];?></td>
                <td><?php echo $v['published'];?></td>
                <td>
                    <a href="<?php echo SITE_URL . 'index.php?a=new&m=recommendIndex';?>&new_id=<?php echo $v['new_id'];?>" target="ajaxTodo" rel="recommend_index_new" title="确定要将这条资讯推荐到首页吗?">首页</a> |
                    <a href="<?php echo SITE_URL . 'index.php?a=new&m=recommendList';?>&new_id=<?php echo $v['new_id'];?>" target="ajaxTodo" rel="recommend_list_new" title="确定要将这条资讯推荐到列表页吗?">列表页</a> |
                    <a href="<?php echo SITE_URL . 'index.php?a=new&m=edit';?>&new_id=<?php echo $v['new_id'];?>" target="dialog" mask="true" height="550" width="900" rel="edit_new">编辑</a> |
                    <a href="<?php echo SITE_URL . 'index.php?a=new&m=del';?>&new_id=<?php echo $v['new_id'];?>" target="ajaxTodo" title="确定要删除吗?">删除</a>
                </td>
            </tr>
        <?php }?>
        </tbody>
    </table>
    <div class="panelBar">
        <div class="pages">
            <span>显示</span>
            <?php
            $_pager_num_type = array(30,50,100);
            ?>
            <select class="combox" name="numPerPage" change="navTabPageBreak" param="numPerPage">
                <?php
                foreach($_pager_num_type as $v){
                    echo '<option value="'.$v.'" '.($list['pager']->per_page == $v ? 'selected':'').'>'.$v.'</option>';
                }
                ?>
            </select>
            <span>条，共<?php echo $list['pager']->getTotalCount();?>条</span>
        </div>

        <div class="pagination" targetType="navTab" totalCount="<?php echo $list['pager']->getTotalCount();?>" numPerPage="<?php echo $list['pager']->per_page;?>" pageNumShown="5" currentPage="<?php echo $list['pager']->curr_page;?>"></div>

    </div>
</div>
<!--通用处理js-->
<script type="text/javascript" src="<?php echo SITE_URL . 'theme/v1/js/admin_common.js'; ?>"></script>
